const ModalClickMixin = {
  data () {
    return {
      title: '操作',
      width: 1000,
      visible: false,
      disableSubmit: false,
      buttonDisable: false
    }
  },
  created() {
  },
  methods: {
    add (value) {
      this.buttonDisable = false
      this.visible = true
      this.$nextTick(() => {
        this.$refs.realForm.add(value);
      })
    },
    edit (record) {
      this.buttonDisable = false
      this.visible = true
      this.$nextTick(() => {
        this.$refs.realForm.edit(record);
      });
    },
    close () {
      this.$emit('close');
      this.visible = false;
    },
    submitCallback(type, record) {
      this.$emit('ok', type, record);
      if (type == 'draft') {
        this.visible = false;
      }
    },
    handleOk () {
      this.buttonDisable = true;
      this.$refs.realForm.submitForm('draft');
    },
    handleCancel () {
      this.close()
    },
    // 点击发起流程
    beginProcess () {
      // this.buttonDisable = true;
      this.$refs.realForm.submitForm('submit');
    },
    unButtonDisable () {
      this.buttonDisable = false
    }
  }
}

export { ModalClickMixin }
